package com.lsl.learn.springcloud.service;

import com.lsl.learn.springcloud.pojo.Dept;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName DeptClientService
 * @Description TODO
 * @Author LSL
 * @Date 2019/8/28 21:43
 * @Version 1.0
 * @Email lsl.yx@foxmail.com
 **/
// 指定微服务名称
//@FeignClient(value = "MICROSERVICECLOUD-DEPT")
// 统一处理fallback
@FeignClient(value = "MICROSERVICECLOUD-DEPT", fallbackFactory = DeptClientServiceFallBackFactory.class)
public interface DeptClientService {

    @GetMapping(value = "/dept/number/{id}")
    Dept number(@PathVariable("id") Long id);

    @GetMapping(value = "/dept/all")
    List<Dept> all();

    @PostMapping(value = "/dept/addition")
    boolean addition(@RequestBody Dept dept);
}
